import { Injectable } from '@angular/core';
import { Http, Response, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs';
import {Categorys} from '../model/categorys';

@Injectable()
export class GetCategoryService {

    categoryDt = {
        categorys: [
            {
                categoryID: 1000,
                title: '居家',
                subCategorys: [
                    {
                        subcategoryID: 100001,
                        title: '夏凉',
                        src:'../../../../../assets/png/13ff4decdf38fe1a5bde34f0e0cc635a.png'
                    },
                    {
                        subcategoryID: 100002,
                        title: '夏凉'
                    },
                    {
                        subcategoryID: 100003,
                        title: '被枕'
                    }
                ]
            },
            {
                categoryID: 2000,
                title: '餐厨',
                subCategorys: [
                    {
                        subcategoryID: 200001,
                        title: '锅具'
                    },
                    {
                        subcategoryID: 200002,
                        title: '杯子'
                    },
                    {
                        subcategoryID: 200003,
                        title: '功能厨具'
                    }
                ]
            },
            {
                categoryID: 3000,
                title: '配件',
                subCategorys: [
                    {
                        subcategoryID: 300001,
                        title: '行李厢'
                    },
                    {
                        subcategoryID: 300002,
                        title: '功能箱包'
                    },
                    {
                        subcategoryID: 200003,
                        title: '双肩包'
                    }
                ]
            },
            {
                categoryID: 4000,
                title: '服装',
                subCategorys: [
                    {
                        subcategoryID: 400001,
                        title: 'T恤'
                    },
                    {
                        subcategoryID: 400002,
                        title: '裤装'
                    },
                    {
                        subcategoryID: 400003,
                        title: '内衣'
                    },
                    {
                        subcategoryID: 400003,
                        title: '袜子'
                    }
                ]
            }

        ]
    }

    getData(): Promise<Categorys> {
        return new Promise((resolve, reject) => {
            setTimeout(() => {
                resolve(this.categoryDt);
            }, 500);
        });
    }
}